package com.clb.toolsbox.factory;

/**
 * author : 常利兵
 * github : <a href="https://github.com/dxmwl">github</a>
 * time   : 2025/6/7 17:14
 * file   : null.java
 * desc   :
 */
import com.clb.toolsbox.toolsJPanel.SidebarToolPanel;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.wm.ToolWindow;
import com.intellij.openapi.wm.ToolWindowFactory;
import com.intellij.ui.content.Content;
import com.intellij.ui.content.ContentFactory;
import org.jetbrains.annotations.NotNull;

public class MyToolWindowFactory implements ToolWindowFactory {

    @Override
    public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
        // 创建左侧的工具列表面板
        SidebarToolPanel sidebarPanel = new SidebarToolPanel();

        // 获取 ContentFactory 实例
        ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
        Content content = contentFactory.createContent(sidebarPanel, "", false);

        // 将内容添加到 ToolWindow 中
        toolWindow.getContentManager().addContent(content);
    }
}

